package com.icepeach.icepeachhomeback.exception;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Taoyuanyuan
 * @create 2023/5/9 15:53
 */
public class Assert {
    public static void isNull(Object object,String message){
        if (null != object){
            throw new ServiceException(message);
        }
    }

    public static void notNull(Object object,String message){
        if (null == object){
            throw new ServiceException(message);
        }
    }

    public static void isBlank(String text,String message){
        if (null != text && !"".equals(text.trim())){
            throw new ServiceException(message);
        }
    }

    public static void notBlank(String text,String message){
        if (null == text || "".equals(text)){
            throw new ServiceException(message);
        }
    }
}
